package com.mxdx.edu.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.mxdx.edu.dao.UserJobBasisSeekerDao;
import com.mxdx.edu.model.UserJobBasisSeekerInfo;
import com.mxdx.edu.service.IUserJobBasisSeekerService;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class UserJobBasisSeekerService implements IUserJobBasisSeekerService {
	
	@Resource
	private UserJobBasisSeekerDao userJobBasisSeekerDao;

	@Override
	public void save(UserJobBasisSeekerInfo userJobBasisSeekerInfo) {
		userJobBasisSeekerDao.save(userJobBasisSeekerInfo);
	}

	@Override
	public Map<String, Object> findJobSeekerMapByMap(Map<String, Object> param) {
		List<Map<String, Object>> list = userJobBasisSeekerDao.findListByMap(param);
		if(list != null && list.size() > 0){
			Map<String, Object> map = list.get(0);
			return map;
		}
		return null;
	}

	@Override
	public void update(UserJobBasisSeekerInfo userJobBasisSeekerInfo) {
		userJobBasisSeekerDao.update(userJobBasisSeekerInfo);
	}

	@Override
	public List<Map<String, Object>> findListByStudentId(String studentId) {
		Map<String, Object> param = new HashMap<>();
		param.put("studentId", studentId);
		return userJobBasisSeekerDao.findListByStudentId(param);
	}

	@Override
	public void updateByMap(Map<String, Object> param) {
		  userJobBasisSeekerDao.updateByMap(param);

	}

	@Override
	public UserJobBasisSeekerInfo get(String jobBasisId) {
		return userJobBasisSeekerDao.queryById(jobBasisId);
	}

	@Override
	public Map<String, Object> findBasisSeekByStudentId(String studentId) {
		return userJobBasisSeekerDao.findBasisSeekByStudentId(studentId);
	}
}
